using System;
using Castle.ActiveRecord;
using CosyTrade.Data;

namespace CosyTrade.Distribution
{
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [ActiveRecord("tabRegionBase"), Serializable, JoinedBase]
    public class RegionBase : BusinessObject
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        private string captionChina;
        private string captionSpain;
        private bool isRootRegion;

        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID", Access = PropertyAccess.NosetterCamelcase)]
        public override Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        [Property]
        public string CaptionChina
        {
            get { return captionChina; }
            set { captionChina = value; }
        }

        [Property]
        public string CaptionSpain
        {
            get { return captionSpain; }
            set { captionSpain = value; }
        }

        [Property]
        public bool IsRootRegion
        {
            get { return isRootRegion; }
            set { isRootRegion = value; }
        }
    }
}